function loginWithEmail(email, nickname) {
  const url = '/api/user'
  return axios.post(
    url,
    {
      email,
      nickname,
    },
  ).then(res => {
    if (res.data.code !== 200) {
      throw new Error(res.data.message)
    } else {
      return res.data.data
    }
  })
}